package com.king.designpatterns.行为模式.策略模式;

/**
 * 环境角色
 *
 * @author king
 * @date 2021-06-10 16:39
 */
public class ContextClient {
    private DiscountStrategy ds;

    public ContextClient(DiscountStrategy ds) {
        this.ds = ds;
    }

    /**
     * 调用策略模式，计算折扣额
     * @return 折扣额
     */
    public double contextCalDisc() {
        return ds.calculateDiscount();
    }
}
